package com.chen.web;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @decription
 * @atuhor:陈红卫
 * @create : 2017-06-21-17:34
 */
@RestController
public class TestController {

    final Logger logger =Logger.getLogger(TestController.class);

    @Autowired
    private RestTemplate restTemplate;


    @RequestMapping(value = "trace1",method = RequestMethod.GET)
    public String trace1(){
        logger.info("<< trace1>>");
        return restTemplate.getForEntity("http://TRACE-2/trace2",String.class).getBody();
    }

}
